<template>
  <section class="tool-main">
    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="model" name="model">model</el-tab-pane>
      <el-tab-pane label="table" name="table">table</el-tab-pane>
      <el-tab-pane label="form" name="form" />
      <el-tab-pane label="menu" name="menu" />
    </el-tabs>
    <template v-if="activeName === 'form'">
      <form-build />
    </template>
    <template v-if="activeName === 'table'">
      <table-build />
    </template>
    <template v-if="activeName === 'menu'">
      <menu-build />
    </template>

  </section>
</template>

<script>
import FormBuild from './build/form/index.vue'
import TableBuild from './build/table/index.vue'
import MenuBuild from './build/menu/index.vue'
export default {
  name: 'ToolMain',
  components: {
    FormBuild,
    TableBuild,
		MenuBuild
  },
  data() {
    return {
      activeName: 'model'
    }
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab.name)
      this.activeName = tab.name
    }
  }
}
</script>

<style lang="scss">
.tool-main {
  /*84 = navbar + tags-view = 50 +34 */
  /* min-height: calc(100vh - 84px); */
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  .el-tabs__content {
    display: none;
  }
}
</style>
